package com.nowcoder.community.dao;

import com.nowcoder.community.entity.Comment;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @ClassName CommentMapper
 * @Description
 * @Author hhwu
 * @Date 2022/5/23 16:09
 * Version 1.0
 **/
@Mapper
public interface CommentMapper {

    // 根据实体类型（评论、帖子、课程等）查询评论
    List<Comment> selectCommentsByEntity(int entityType, int entityId, int offset, int limit);

    // 查询评论数据的条目数
    int selectCountByEntity(int entityType, int entityId);

    int insertComment(Comment comment);

    Comment selectCommentById(int id);
}
